package com.bort.system.common;

import javafx.application.Platform;
import javafx.stage.Stage;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class TrayIconActionListener implements ActionListener {

    Stage stage;

    public TrayIconActionListener(Stage primaryStage) {
        stage = primaryStage;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        Platform.runLater(new Runnable() {
            @Override
            public void run() {
                stage.show();
                stage.setIconified(false);
            }
        });
    }
}
